<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>Document</title>
  <style>
    #wrap{
      width: 700px;
    }
  </style>
</head>
<body>
  <div id="wrap"></div>
  <div id="mark">
    <div class="mark">
      <input type="text"> <button class="emit" type="button">发送</button>
    </div>
  </div>
  <script src="http://lib.baomitu.com/jquery/3.2.1/jquery.js"></script>
  <script src="../node_modules/chimee/lib/index.browser.js"></script>
  <script src="../node_modules/chimee-plugin-controlbar/lib/index.browser.js"></script>
  <script src="../lib/index.browser.js"></script>
  <script>
    Chimee.install(chimeePluginDanmu);
    Chimee.install(chimeePluginControlbar);
    const player = new Chimee({
      wrapper: '#wrap',
      src: 'http://yunxianchang.live.ujne7.com/vod-system-bj/103_371ab0c0fda-143d-4755-8727-d3cd12dce02d.mp4',
      isLive: false,
      plugin: [{
        name: chimeePluginDanmu.name,
        mode: 'css',
        updateByVideo: false,
        fontSize: 12,
        lineHeight: 70,
        speed: 3000,
      }, chimeePluginControlbar.name],
      autoplay: true,
      controls: true,
      volume: 0
    });
    $('.emit').click(function () {
      var text = $('input').val();
      player.__dispatcher.plugins.chimeeDanmu.sendMsg({text, speed: 5, fontSize: 50});
    })
    player.on('danmuContextmenu', function (d) {
      console.log(d);
    })
  </script>
</body>
</html>